﻿--#include "data\functions\Fuben\MagicCity.lua" once   --魔域迷城

local npcId = 147
NpcDialog[npcId] = {}
local t = NpcDialog[npcId]

t.main = function(sysarg)
	--print("t.main, npcId="..npcId)
	local strCond = "达到一定转数和等级"

	local radios = 
	{
		{ btnName = "进入魔域迷城1", 	sceneIdx = 1, },
		{ btnName = "进入魔域迷城2", 	sceneIdx = 2, },
		{ btnName = "进入魔域迷城3", 	sceneIdx = 3, },
		{ btnName = "进入魔域迷城4", 	sceneIdx = 4, },
	}

	-----------------
	local strDesc = ""
	for i = 1, #radios do
		strDesc = strDesc .. string.format("{radio;1;%d;%s}", i, radios[i].btnName)
	end
	
	strDesc = strDesc .. "按等级进入魔域迷城"
	------------------
	local okBtn = "{btn;0;进入魔域迷城;%s;}"			--{按钮;样式;按钮名;函数名;描述}
	local strBtnList = string.format(okBtn, "EnterMagicCityFromNpc,%d")

	--local localFun = string.format("OpenView,%s,%d", enLinkBuyItemWnd, cfg.itemId)
	--strBtnList = strBtnList .. string.format(cfg.buyBtn, localFun)

	-----------------
	local pack = DataPack.allocPacket(sysarg, LogicCmd.npcDialogSys.sysID, LogicCmd.npcDialogSys.sub.sNpcDlgData)
	
	DataPack.writeUint64(pack, Actor.getNpc(sysarg))
	DataPack.writeByte(pack, NpcDialogType.FYSDNpcDlg)
	DataPack.writeString(pack, strCond)
	DataPack.writeString(pack, strDesc)
	DataPack.writeString(pack, strBtnList)
	DataPack.writeChar(pack, -1)
	DataPack.writeByte(pack, 0);
	DataPack.flush(pack)

	return str
end

--进入活动场景
t.EnterMagicCityFromNpc = function ( sysarg, cityIdx )
	cityIdx = tonumber(cityIdx)
	--print("EnterMagicCityFromNpc, cityIdx="..cityIdx)
	EnterMagicCity( sysarg, cityIdx )
end
